package com.ysdcrm.crm.controller;

import java.util.List;

import javax.annotation.Resource;

import com.ysdcrm.crm.mapper.IClocksMapper;
import com.ysdcrm.crm.model.Clocks;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;

@RestController
@ApiOperation(value = "打卡管理")
@RequestMapping("clock")
public class ClocksController {
    @Resource
    private IClocksMapper mapper;

    @GetMapping
    @ApiOperation(value = "查询当天打卡信息")
    public List<Clocks> findToday(Clocks c){
        return mapper.findToday(c);
    }

    @ApiOperation(value = "打卡")
    @PostMapping("clock")
    public int clock(Clocks c){
        return mapper.clock(c);
    }
}
